package com.wys.study.serviceb.controller;

import com.wys.study.serviceb.entity.Account;
import com.wys.study.serviceb.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wuyanshen
 * @date 2020-03-13 5:17 下午
 * @discription 描述
 */
@RestController
public class ServiceBController {

    @Autowired
    private AccountService accountService;

    @GetMapping("add")
    public String add(@RequestParam("money") int money,@RequestParam("username") String username){
        Account account = new Account();
        account.setMoney(money);
        account.setUsername(username);
        return accountService.update(account);
    }
}
